//
//  NSObject.swift
//  CMKit
//
//  Created by travel on 2016/12/15.
//  Copyright © 2016年 covermedia. All rights reserved.
//

import Foundation


public extension NSObject {
    /// 类全名
    public var fullClassName: String {
        return  NSStringFromClass(type(of: self))
    }
    
    /// 类名
    public var className : String {
        return  NSStringFromClass(type(of: self)).components(separatedBy: ".").last ?? NSStringFromClass(type(of: self))
    }
    
    /// 类全名
    public class var fullClassName : String {
        return  NSStringFromClass(self)
    }
    
    /// 类名
    public class var className : String {
        return  NSStringFromClass(self).components(separatedBy: ".").last ?? NSStringFromClass(self)
    }
    
    /// 唯一标识
    public var identifier: ObjectIdentifier {
        return  ObjectIdentifier(self)
    }
    
    /// 唯一标识字符串
    public var identifierString: String {
        return "\(UInt(bitPattern: ObjectIdentifier(self)))"
    }
}
